var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var ResKeeper = require("AA_ResKeeper");
var Excel = require("AA_Excel");
var GameDataManager = require("AA_GameDataManager");
var GameGlobalVariable = require("AA_GameGlobalVariable");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
_decorator.property;

var _def_UI_ShowBag = function (e) {
  function _creator() {
    return null !== e && e.apply(this, arguments) || this;
  }
  __extends(_creator, e);
  _creator.prototype.onEnable = function () {
    var e = this;
    this.scheduleOnce(function () {
      var t = GameGlobalVariable.GameGlobalVariable.nowlevel;
      1 == GameGlobalVariable.GameGlobalVariable.isTeShuLevel() && (t = GameGlobalVariable.GameGlobalVariable.teshulevel);
      var o = GameDataManager.GameDataMgr.getNowLevelBoshuState(t, GameGlobalVariable.GameGlobalVariable.isTeShuLevel());
      if (null != o) {
        var n = Excel.Excel.shuiguoguanqia(t);
        console.log("当前关卡数据", n);
        if (n) {
          var i = n.levelboshuid[o];
          console.log("当前关卡数据", i);
          if (i) {
            var a = Excel.Excel.shuiguoboshu(i);
            console.log("当前关卡数据", a);
            if (a) {
              var r = a.mosterid;
              var c = false;
              for (var d = 0; d < r.length; d++) {
                var p = r[d];
                if (1 == Excel.Excel.shuiguoguaiwu(p[0]).boss) {
                  c = true;
                  break;
                }
              }
              e.node.children[0].active = c;
              if (c) {
                e.node.children[0].opacity = 255;
                e.scheduleOnce(function () {
                  cc.tween(e.node.children[0]).to(.2, {
                    opacity: 0
                  }).call(function () {
                    e.node.children[0].active = false;
                  }).start();
                }, 5);
              }
            } else {
              e.node.children[0].active = false;
            }
          } else {
            e.node.children[0].active = false;
          }
        } else {
          e.node.children[0].active = false;
        }
      }
    }, .1);
  };
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_UI_ShowBag;